package com.chinemit.cui.components.tooltips
{
	import com.chinemit.cui.components.core.CUIComponent;
	
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import flash.display.Sprite;
	
	public class Tooltip extends CUIComponent
	{
		
		public static const TYPE_ANIM_LEFT:String = "animLeft"; // 锁定向左边移出
		public static const TYPE_ANIM_RIGHT:String = "animRight"; //锁定向右边移出
		public static const TYPE_ANIM_TOP:String = "animTop"; //锁定向上移出
		public static const TYPE_ANIM_BOTTOM:String = "animBottom"; //锁定向下移出
		public static const TYPE_ANIM_FREEDOM:String = "animFreedom"; //跟随鼠标自由活动
		
		private static var instance:Tooltip; //本类单例
		
		private var area:DisplayObject;
		private var _type:String;

		public function get type():String
		{
			return _type;
		}

		public function set type(value:String):void
		{
			_type = value;
		}

		private var renderer:DisplayObject;
		
		public function Tooltip(){
			super();
		}
		
		/**
		 * 注册TOOLTIP
		 * @param area 注册区域
		 * @param message ToolTip 显示文本信息.
		 *
		 */
		public function init(area:DisplayObjectContainer,renderer:ITooltipRenderer,animType:String):void{
			if (instance != null)
			{
//				area.addChild(instance);
//				var prop:AccessibilityProperties=new AccessibilityProperties();
//				prop.description=message;
//				area.accessibilityProperties=prop;
//				area.addEventListener(MouseEvent.MOUSE_OVER, instance.mouseEventHandler);
			}
		}
		
		/**
		 * 注销 
		 * @param area
		 * 
		 */		
		public function unregister(area:DisplayObject):void
		{
			if (instance != null)
			{
//				area.removeEventListener(MouseEvent.MOUSE_OVER, instance.mouseEventHandler);
			}
		}
		
		/**
		 * 获得本类单例
		 * @param area 单例父级容器区域
		 * @return
		 *
		 */
		public static function getInstance():Tooltip
		{
			if (!instance)
			{
				instance=new Tooltip();
			}
			return instance;
		}
	}
}